/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ifpb.pp.rh.util;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Gabriella
 */
public class ContextUtil{
    
        //pega o HttpSession
        public static HttpSession getSession(){
            FacesContext context = FacesContext.getCurrentInstance();
            HttpSession session = (HttpSession) context.getExternalContext().getSession(true);
            return session;
        }

        //pega o HttpServletRequest
        public static HttpServletRequest getRequest(){
             FacesContext context = FacesContext.getCurrentInstance();
             HttpServletRequest request= (HttpServletRequest) context.getExternalContext().getRequest();
             return request;

        }

}
